export const deviceInfoCmd = {
  hdc: {
    getDeviceList: "hdc list targets -v",
    getDeviceInfo: (SN) =>
      `hdc ${
        SN ? `-t ${SN}` : ""
      } shell "param get const.product.cpu.abilist && param get const.product.name && param get const.product.model && param get const.ohos.fullname"`,
    getCPUFreq: (SN) =>
      `hdc ${SN ? `-t ${SN}` : ""} shell "SP_daemon -N 1 -c |grep Frequency"`,
    getGPUFreq: (SN) =>
      `hdc ${SN ? `-t ${SN}` : ""} shell "SP_daemon -N 1 -g |grep Frequency"`,
    getCPUCoreNum: (SN) =>
      `hdc ${
        SN ? `-t ${SN}` : ""
      } shell "cat /proc/cpuinfo | grep ^processor | wc -l"`,
    getCPUType: (SN) =>
      `hdc ${
        SN ? `-t ${SN}` : ""
      } shell "cat /sys/class/thermal/thermal_zone7/type"`,
    getIp: (SN) => `hdc ${SN ? `-t ${SN}` : ""} shell "ifconfig | grep Bcast"`,
    connectByUsb: (SN) => `hdc ${SN ? `-t ${SN}` : ""} tmode usb`,
    connectByWifi: (SN) => `hdc ${SN ? `-t ${SN}` : ""} tmode port 5555`,
    connectByPort: (SN, Ip) => `hdc ${SN ? `-t ${SN}` : ""} tconn ${Ip}:5555`,
    kill: (SN) => `hdc ${SN ? `-t ${SN}` : ""} kill`,
    restart: (SN) => `hdc ${SN ? `-t ${SN}` : ""} start -r`,
    getSN: (SN) => `hdc -t ${SN} shell param get ohos.boot.sn`,
  },
  adb: {
    getDeviceList: "adb devices -l",
    getOpenGLInfo: (SN) =>
      `adb ${SN ? `-s ${SN}` : ""} shell "dumpsys SurfaceFlinger | grep GLES"`,
    getCPUArch: (SN) =>
      `adb ${SN ? `-s ${SN}` : ""} shell "getprop ro.product.cpu.abi"`,
    getCPUType: (SN) =>
      `adb ${SN ? `-s ${SN}` : ""} shell "getprop ro.board.chiptype"`,
    getOSApiVersion: (SN) =>
      `adb ${SN ? `-s ${SN}` : ""} shell "getprop hw_sc.build.os.apiversion"`,
    getSystemVersion: (SN) =>
      `adb ${SN ? `-s ${SN}` : ""} shell getprop ro.build.version.release`,
    getCPUInfo: (SN) => `adb ${SN ? `-s ${SN}` : ""} shell cat /proc/cpuinfo`,
    getWinSize: (SN) => `adb ${SN ? `-s ${SN}` : ""} shell wm size`,
    getDeviceType: (SN) =>
      `adb ${SN ? `-s ${SN}` : ""} shell getprop ro.product.model`,
    detDeviceName: (SN) =>
      `adb ${SN ? `-s ${SN}` : ""} shell getprop ro.product.name`,
    getCPUFreq: (SN) =>
      `adb ${
        SN ? `-s ${SN}` : ""
      } shell cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies`,
    getGPUFreq: (SN) =>
      `adb ${
        SN ? `-s ${SN}` : ""
      } shell cat /sys/class/devfreq/gpufreq/cur_freq`,
    getIp: (SN) => `adb ${SN ? `-s ${SN}` : ""}  shell "ifconfig | grep Bcast"`,
    connectByUsb: (SN) => `adb ${SN ? `-s ${SN}` : ""} usb`,
    connectByWifi: (SN) => `adb ${SN ? `-s ${SN}` : ""} tcpip 5555`,
    connectByPort: (SN, Ip) => `adb ${SN ? `-s ${SN}` : ""} connect ${Ip}`,
    kill: (SN) => `adb ${SN ? `-s ${SN}` : ""} kill-server`,
    restart: (SN) => `adb ${SN ? `-s ${SN}` : ""} start-server`,
    getSN: (SN) => `adb -s ${SN} shell getprop ro.serialno`,
  },
};

export const appListCmd = {
  hdc: {
    grepEditorApp: (SN) =>
      `hdc ${
        SN ? `-t ${SN}` : ""
      } shell "bm dump -a | grep com.ohos.editorapp"`,
    unstallEditorTool: (SN) =>
      `hdc ${SN ? `-t ${SN}` : ""} uninstall com.ohos.editorapp`,
    installEditorTool: (SN, appPath) =>
      `hdc ${SN ? `-t ${SN}` : ""} install ${appPath ? `${appPath}` : ""}`,
    mkdir: (SN) =>
      `hdc ${
        SN ? `-t ${SN}` : ""
      } shell mkdir -p /data/app/el2/100/base/com.ohos.editorapp/haps/entry/files`,
    grantPermissions: (SN) =>
      `hdc ${
        SN ? `-t ${SN}` : ""
      } shell chmod 777 /data/app/el2/100/base/com.ohos.editorapp/haps/entry/files`,
    getAllAppList: (SN) =>
      `hdc ${
        SN ? `-t ${SN}` : ""
      } shell aa test -b com.ohos.editorapp -m entry -s unittest EditorTestRunner -s type desk_app_list`,
    fileRecv: (SN, filePath) =>
      `hdc ${
        SN ? `-t ${SN}` : ""
      } file recv /data/app/el2/100/base/com.ohos.editorapp/haps/entry/files/appnames.txt ${
        filePath ? `${filePath}` : ""
      }`,
  },
};

export const snapShotCmd = {
  hdc: {
    filePath: `/data/local/tmp/snapShot/`,
    mkdir: (SN) =>
      `hdc ${SN ? `-t ${SN}` : ""} shell mkdir -p /data/local/tmp/snapShot/`,
    chmod: (SN) =>
      `hdc ${
        SN ? `-t ${SN}` : ""
      } shell chmod 777 -p /data/local/tmp/snapShot/`,
    snapshot: (SN, fileName) =>
      `hdc ${SN ? `-t ${SN}` : ""} shell "snapshot_display -f ${
        fileName ? `${fileName}` : ""
      }"`,
    recv: (SN, fileName, localPath) =>
      `hdc ${SN ? `-t ${SN}` : ""} file recv ${fileName ? `${fileName}` : ""} ${
        localPath ? `${localPath}` : ""
      }`,
  },
};

export const startAppCmd={
  hdc:{
    allAppInfo:(SN) =>`hdc ${SN ? `-t ${SN}` : ""} shell wokong appinfo`,
    startApp:(SN) =>`hdc ${SN ? `-t ${SN}` : ""} shell aa start `,

  }
}
